package com.text;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

@Configuration
@ComponentScan(basePackages = "com.text")
@PropertySource("classpath:application.properties")
public class Main {
    @Value("${version}")
    private String version;

    @Value("${name}")
    private String name;

    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(Main.class);
        Main main = context.getBean(Main.class);
        System.out.println("Hello world!");
        System.out.println("version: " + main.version);
        System.out.println("name: " + main.name);
    }
}